import { Rule } from "./types";

export const PylintErrorRuleList: Rule[] = [
    {
        code: "PLE0100",
        name: "yield-in-init",
        descEn: "__init__ method is a generator",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLE0101",
        name: "return-in-init",
        descEn: "Explicit return in __init__",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLE0116",
        name: "continue-in-finally",
        descEn: "continue not supported inside finally clause",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLE0117",
        name: "nonlocal-without-binding",
        descEn: "Nonlocal name {name} found without binding",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLE0118",
        name: "load-before-global-declaration",
        descEn: "Name {name} is used prior to global declaration on line",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLE0302",
        name: "unexpected-special-method-signature",
        descEn: "The special method {} expects {}, {} {} given",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLE0604",
        name: "invalid-all-object",
        descEn: "Invalid object in __all__, must contain only strings",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLE0605",
        name: "invalid-all-format",
        descEn: "Invalid format for __all__, must be tuple or list",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLE1142",
        name: "await-outside-async",
        descEn: "await should be used within an async function",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLE1205",
        name: "logging-too-many-args",
        descEn: "Too many arguments for logging format string",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLE1206",
        name: "logging-too-few-args",
        descEn: "Not enough arguments for logging format string",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLE1307",
        name: "bad-string-format-type",
        descEn: "Format type does not match argument type",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLE1310",
        name: "bad-str-strip-call",
        descEn: "String {strip} call contains duplicate characters (did you mean {removal}?)",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLE1507",
        name: "invalid-envvar-value",
        descEn: "Invalid type for initial os.getenv argument; expected str",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLE2502",
        name: "bidirectional-unicode",
        descEn: "Contains control characters that can permit obfuscated code",
        descCn: "",
        autoFix: false,
    },
    {
        code: "PLE2510",
        name: "invalid-character-backspace",
        descEn: `Invalid unescaped character backspace, use "\b" instead`,
        descCn: "",
        autoFix: true,
    },
    {
        code: "PLE2512",
        name: "invalid-character-sub",
        descEn: `Invalid unescaped character SUB, use "\x1A" instead`,
        descCn: "",
        autoFix: true,
    },
    {
        code: "PLE2513",
        name: "invalid-character-esc",
        descEn: `Invalid unescaped character ESC, use "\\x1B" instead`,
        descCn: "",
        autoFix: true,
    },
    {
        code: "PLE2514",
        name: "invalid-character-nul",
        descEn: `Invalid unescaped character NUL, use "\\0" instead`,
        descCn: "",
        autoFix: true,
    },
    {
        code: "PLE2515",
        name: "invalid-character-zero-width-space",
        descEn: `Invalid unescaped character zero-width-space, use "\\u200B" instead`,
        descCn: "",
        autoFix: true,
    },
];